/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package vn.adcc.model;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;
import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;

/**
 *
 * @author duccom
 */
@Entity
@Table(name = "contract")
@XmlRootElement
@Searchable
@NamedQueries({
    @NamedQuery(name = "Contract.findAll", query = "SELECT c FROM Contract c"),
    @NamedQuery(name = "Contract.findById", query = "SELECT c FROM Contract c WHERE c.id = :id"),
    @NamedQuery(name = "Contract.findByContractCode", query = "SELECT c FROM Contract c WHERE c.contractCode = :contractCode"),
    @NamedQuery(name = "Contract.findByContent", query = "SELECT c FROM Contract c WHERE c.content = :content"),
    @NamedQuery(name = "Contract.findBySignedDate", query = "SELECT c FROM Contract c WHERE c.signedDate = :signedDate"),
    @NamedQuery(name = "Contract.findByDayToFinish", query = "SELECT c FROM Contract c WHERE c.dayToFinish = :dayToFinish"),
    @NamedQuery(name = "Contract.findByCheckTakeOver", query = "SELECT c FROM Contract c WHERE c.checkTakeOver = :checkTakeOver"),
    @NamedQuery(name = "Contract.findByCustomerName", query = "SELECT c FROM Contract c WHERE c.customerName = :customerName"),
    @NamedQuery(name = "Contract.findByCustomerPresentor", query = "SELECT c FROM Contract c WHERE c.customerPresentor = :customerPresentor"),
    @NamedQuery(name = "Contract.findByCustomerTitle", query = "SELECT c FROM Contract c WHERE c.customerTitle = :customerTitle"),
    @NamedQuery(name = "Contract.findByCustomerAddress", query = "SELECT c FROM Contract c WHERE c.customerAddress = :customerAddress"),
    @NamedQuery(name = "Contract.findByCustomerPhone", query = "SELECT c FROM Contract c WHERE c.customerPhone = :customerPhone"),
    @NamedQuery(name = "Contract.findByCustomerFax", query = "SELECT c FROM Contract c WHERE c.customerFax = :customerFax"),
    @NamedQuery(name = "Contract.findByCustomerAccount", query = "SELECT c FROM Contract c WHERE c.customerAccount = :customerAccount"),
    @NamedQuery(name = "Contract.findByCustomerTaxCode", query = "SELECT c FROM Contract c WHERE c.customerTaxCode = :customerTaxCode"),
    @NamedQuery(name = "Contract.findByComName", query = "SELECT c FROM Contract c WHERE c.comName = :comName"),
    @NamedQuery(name = "Contract.findByComPresentor", query = "SELECT c FROM Contract c WHERE c.comPresentor = :comPresentor"),
    @NamedQuery(name = "Contract.findByComTitle", query = "SELECT c FROM Contract c WHERE c.comTitle = :comTitle"),
    @NamedQuery(name = "Contract.findByComAddress", query = "SELECT c FROM Contract c WHERE c.comAddress = :comAddress"),
    @NamedQuery(name = "Contract.findByComPhone", query = "SELECT c FROM Contract c WHERE c.comPhone = :comPhone"),
    @NamedQuery(name = "Contract.findByComFax", query = "SELECT c FROM Contract c WHERE c.comFax = :comFax"),
    @NamedQuery(name = "Contract.findByComAccount", query = "SELECT c FROM Contract c WHERE c.comAccount = :comAccount"),
    @NamedQuery(name = "Contract.findByComTaxCode", query = "SELECT c FROM Contract c WHERE c.comTaxCode = :comTaxCode"),
    @NamedQuery(name = "Contract.findByContractValueTotal", query = "SELECT c FROM Contract c WHERE c.contractValueTotal = :contractValueTotal"),
    @NamedQuery(name = "Contract.findByContractValueA1", query = "SELECT c FROM Contract c WHERE c.contractValueA1 = :contractValueA1"),
    @NamedQuery(name = "Contract.findByContractValueA2", query = "SELECT c FROM Contract c WHERE c.contractValueA2 = :contractValueA2"),
    @NamedQuery(name = "Contract.findByContractValueA3", query = "SELECT c FROM Contract c WHERE c.contractValueA3 = :contractValueA3"),
    @NamedQuery(name = "Contract.findByContractValueA4", query = "SELECT c FROM Contract c WHERE c.contractValueA4 = :contractValueA4"),
    @NamedQuery(name = "Contract.findByContractValueA5", query = "SELECT c FROM Contract c WHERE c.contractValueA5 = :contractValueA5"),
    @NamedQuery(name = "Contract.findByPaidValueTotal", query = "SELECT c FROM Contract c WHERE c.paidValueTotal = :paidValueTotal"),
    @NamedQuery(name = "Contract.findByPaidValueA1", query = "SELECT c FROM Contract c WHERE c.paidValueA1 = :paidValueA1"),
    @NamedQuery(name = "Contract.findByPaidValueA2", query = "SELECT c FROM Contract c WHERE c.paidValueA2 = :paidValueA2"),
    @NamedQuery(name = "Contract.findByPaidValueA3", query = "SELECT c FROM Contract c WHERE c.paidValueA3 = :paidValueA3"),
    @NamedQuery(name = "Contract.findByPaidValueA4", query = "SELECT c FROM Contract c WHERE c.paidValueA4 = :paidValueA4"),
    @NamedQuery(name = "Contract.findByPaidValueA5", query = "SELECT c FROM Contract c WHERE c.paidValueA5 = :paidValueA5"),
    @NamedQuery(name = "Contract.findByMoneyRecieved", query = "SELECT c FROM Contract c WHERE c.moneyRecieved = :moneyRecieved"),
    @NamedQuery(name = "Contract.findByMoneyRemaining", query = "SELECT c FROM Contract c WHERE c.moneyRemaining = :moneyRemaining"),
    @NamedQuery(name = "Contract.findByComment", query = "SELECT c FROM Contract c WHERE c.comment = :comment")})
public class Contract implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @SearchableId
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    @Basic(optional = false)
    @SearchableProperty
    @Column(name = "contract_code")
    private String contractCode;
    @Basic(optional = false)
    @SearchableProperty
    @Column(name = "content")
    private String content;
    @Basic(optional = false)
    @SearchableProperty
    @Column(name = "signed_date")
    @Temporal(TemporalType.DATE)
    private Date signedDate;
    @Basic(optional = false)
    @SearchableProperty
    @Column(name = "day_to_finish")
    private int dayToFinish;
    @SearchableProperty
    @Column(name = "check_take_over")
    private Integer checkTakeOver;
    @SearchableProperty
    @Column(name = "customer_name")
    private String customerName;
    @Column(name = "customer_presentor")
    @SearchableProperty
    private String customerPresentor;
    @Column(name = "customer_title")
    @SearchableProperty
    private String customerTitle;
    @Column(name = "customer_address")
    @SearchableProperty
    private String customerAddress;
    @Column(name = "customer_phone")
    @SearchableProperty
    private String customerPhone;
    @Column(name = "customer_fax")
    @SearchableProperty
    private String customerFax;
    @Column(name = "customer_account")
    @SearchableProperty
    private String customerAccount;
    @Column(name = "customer_tax_code")
    @SearchableProperty
    private String customerTaxCode;
    @Column(name = "com_name")
    @SearchableProperty
    private String comName;
    @Column(name = "com_presentor")
    @SearchableProperty
    private String comPresentor;
    @Column(name = "com_title")
    @SearchableProperty
    private String comTitle;
    @Column(name = "com_address")
    @SearchableProperty
    private String comAddress;
    @Column(name = "com_phone")
    @SearchableProperty
    private String comPhone;
    @Column(name = "com_fax")
    @SearchableProperty
    private String comFax;
    @Column(name = "com_account")
    @SearchableProperty
    private String comAccount;
    @Column(name = "com_tax_code")
    @SearchableProperty
    private String comTaxCode;
    @Column(name = "contract_value_total")
    @SearchableProperty
    private BigInteger contractValueTotal;
    @Column(name = "contract_value_a1")
    @SearchableProperty
    private BigInteger contractValueA1;
    @Column(name = "contract_value_a2")
    @SearchableProperty
    private BigInteger contractValueA2;
    @Column(name = "contract_value_a3")
    @SearchableProperty
    private BigInteger contractValueA3;
    @Column(name = "contract_value_a4")
    @SearchableProperty
    private BigInteger contractValueA4;
    @Column(name = "contract_value_a5")
    @SearchableProperty
    private BigInteger contractValueA5;
    @Column(name = "paid_value_total")
    @SearchableProperty
    private BigInteger paidValueTotal;
    @Column(name = "paid_value_a1")
    @SearchableProperty
    private BigInteger paidValueA1;
    @Column(name = "paid_value_a2")
    @SearchableProperty
    private BigInteger paidValueA2;
    @Column(name = "paid_value_a3")
    @SearchableProperty
    private BigInteger paidValueA3;
    @Column(name = "paid_value_a4")
    @SearchableProperty
    private BigInteger paidValueA4;
    @Column(name = "paid_value_a5")
    @SearchableProperty
    private BigInteger paidValueA5;
    @Column(name = "money_recieved")
    @SearchableProperty
    private BigInteger moneyRecieved;
    @Column(name = "money_remaining")
    @SearchableProperty
    private BigInteger moneyRemaining;
    @Column(name = "comment")
    @SearchableProperty
    private String comment;

    public Contract() {
    }

    public Contract(Integer id) {
        this.id = id;
    }

    public Contract(Integer id, String contractCode, String content, Date signedDate, int dayToFinish) {
        this.id = id;
        this.contractCode = contractCode;
        this.content = content;
        this.signedDate = signedDate;
        this.dayToFinish = dayToFinish;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getContractCode() {
        return contractCode;
    }

    public void setContractCode(String contractCode) {
        this.contractCode = contractCode;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getSignedDate() {
        return signedDate;
    }

    public void setSignedDate(Date signedDate) {
        this.signedDate = signedDate;
    }

    public int getDayToFinish() {
        return dayToFinish;
    }

    public void setDayToFinish(int dayToFinish) {
        this.dayToFinish = dayToFinish;
    }

    public Integer getCheckTakeOver() {
        return checkTakeOver;
    }

    public void setCheckTakeOver(Integer checkTakeOver) {
        this.checkTakeOver = checkTakeOver;
    }

    public String getCustomerName() {
        return customerName;
    }

    public void setCustomerName(String customerName) {
        this.customerName = customerName;
    }

    public String getCustomerPresentor() {
        return customerPresentor;
    }

    public void setCustomerPresentor(String customerPresentor) {
        this.customerPresentor = customerPresentor;
    }

    public String getCustomerTitle() {
        return customerTitle;
    }

    public void setCustomerTitle(String customerTitle) {
        this.customerTitle = customerTitle;
    }

    public String getCustomerAddress() {
        return customerAddress;
    }

    public void setCustomerAddress(String customerAddress) {
        this.customerAddress = customerAddress;
    }

    public String getCustomerPhone() {
        return customerPhone;
    }

    public void setCustomerPhone(String customerPhone) {
        this.customerPhone = customerPhone;
    }

    public String getCustomerFax() {
        return customerFax;
    }

    public void setCustomerFax(String customerFax) {
        this.customerFax = customerFax;
    }

    public String getCustomerAccount() {
        return customerAccount;
    }

    public void setCustomerAccount(String customerAccount) {
        this.customerAccount = customerAccount;
    }

    public String getCustomerTaxCode() {
        return customerTaxCode;
    }

    public void setCustomerTaxCode(String customerTaxCode) {
        this.customerTaxCode = customerTaxCode;
    }

    public String getComName() {
        return comName;
    }

    public void setComName(String comName) {
        this.comName = comName;
    }

    public String getComPresentor() {
        return comPresentor;
    }

    public void setComPresentor(String comPresentor) {
        this.comPresentor = comPresentor;
    }

    public String getComTitle() {
        return comTitle;
    }

    public void setComTitle(String comTitle) {
        this.comTitle = comTitle;
    }

    public String getComAddress() {
        return comAddress;
    }

    public void setComAddress(String comAddress) {
        this.comAddress = comAddress;
    }

    public String getComPhone() {
        return comPhone;
    }

    public void setComPhone(String comPhone) {
        this.comPhone = comPhone;
    }

    public String getComFax() {
        return comFax;
    }

    public void setComFax(String comFax) {
        this.comFax = comFax;
    }

    public String getComAccount() {
        return comAccount;
    }

    public void setComAccount(String comAccount) {
        this.comAccount = comAccount;
    }

    public String getComTaxCode() {
        return comTaxCode;
    }

    public void setComTaxCode(String comTaxCode) {
        this.comTaxCode = comTaxCode;
    }

    public BigInteger getContractValueTotal() {
        return contractValueTotal;
    }

    public void setContractValueTotal(BigInteger contractValueTotal) {
        this.contractValueTotal = contractValueTotal;
    }

    public BigInteger getContractValueA1() {
        return contractValueA1;
    }

    public void setContractValueA1(BigInteger contractValueA1) {
        this.contractValueA1 = contractValueA1;
    }

    public BigInteger getContractValueA2() {
        return contractValueA2;
    }

    public void setContractValueA2(BigInteger contractValueA2) {
        this.contractValueA2 = contractValueA2;
    }

    public BigInteger getContractValueA3() {
        return contractValueA3;
    }

    public void setContractValueA3(BigInteger contractValueA3) {
        this.contractValueA3 = contractValueA3;
    }

    public BigInteger getContractValueA4() {
        return contractValueA4;
    }

    public void setContractValueA4(BigInteger contractValueA4) {
        this.contractValueA4 = contractValueA4;
    }

    public BigInteger getContractValueA5() {
        return contractValueA5;
    }

    public void setContractValueA5(BigInteger contractValueA5) {
        this.contractValueA5 = contractValueA5;
    }

    public BigInteger getPaidValueTotal() {
        return paidValueTotal;
    }

    public void setPaidValueTotal(BigInteger paidValueTotal) {
        this.paidValueTotal = paidValueTotal;
    }

    public BigInteger getPaidValueA1() {
        return paidValueA1;
    }

    public void setPaidValueA1(BigInteger paidValueA1) {
        this.paidValueA1 = paidValueA1;
    }

    public BigInteger getPaidValueA2() {
        return paidValueA2;
    }

    public void setPaidValueA2(BigInteger paidValueA2) {
        this.paidValueA2 = paidValueA2;
    }

    public BigInteger getPaidValueA3() {
        return paidValueA3;
    }

    public void setPaidValueA3(BigInteger paidValueA3) {
        this.paidValueA3 = paidValueA3;
    }

    public BigInteger getPaidValueA4() {
        return paidValueA4;
    }

    public void setPaidValueA4(BigInteger paidValueA4) {
        this.paidValueA4 = paidValueA4;
    }

    public BigInteger getPaidValueA5() {
        return paidValueA5;
    }

    public void setPaidValueA5(BigInteger paidValueA5) {
        this.paidValueA5 = paidValueA5;
    }

    public BigInteger getMoneyRecieved() {
        return moneyRecieved;
    }

    public void setMoneyRecieved(BigInteger moneyRecieved) {
        this.moneyRecieved = moneyRecieved;
    }

    public BigInteger getMoneyRemaining() {
        return moneyRemaining;
    }

    public void setMoneyRemaining(BigInteger moneyRemaining) {
        this.moneyRemaining = moneyRemaining;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Contract)) {
            return false;
        }
        Contract other = (Contract) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "vn.adcc.model.Contract[ id=" + id + " ]";
    }

}
